#! /bin/bash

order=$(netstat -nlp | grep :8081 | awk '{print $7}' | awk -F"/" '{ print $1 }')

product=$(netstat -nlp | grep :8082 | awk '{print $7}' | awk -F"/" '{ print $1 }')

shopping=$(netstat -nlp | grep :8083 | awk '{print $7}' | awk -F"/" '{ print $1 }')

web=$(netstat -nlp | grep :8084 | awk '{print $7}' | awk -F"/" '{ print $1 }')


if [ -n "$order" ]; then
  kill -9 "$order"
  echo "kill 8081 order success $order"
fi

if [ -n "$product" ]; then
  kill -9 "$product"
  echo "kill 8082 product success $product"
fi

if [ -n "$shopping" ]; then
  kill -9 "$shopping"
  echo "kill 8083 shopping-cart success $shopping"
fi

if [ -n "$web" ]; then
  kill -9 "$web"
  echo "kill 8083 shopping-cart success $web"
fi



